#ifndef _CHAT_SERVER_INTERFACE_H
#define _CHAT_SERVER_INTERFACE_H

class DLL_EXPORT IChatEventHandler abstract
{
public:
	virtual void OnInternalMessage(const char* message, Player* sender) = 0;
	virtual void OnPlayerLoggedIn(Player* login, bool trueplayer) = 0;
	virtual void OnPlayerLoggedOut(Player* logout, bool trueplayer) = 0;
};

class DLL_EXPORT IChatServer abstract : public IUnkInterface
{
public:
	virtual void SendChatMessage(const char* message, ...) = 0;
	virtual void SendChatMessageToTeam(bool horde, const char* message, ...) = 0;
	virtual void SendChatMessageToZone(ui32 zoneid, const char* message, ...) = 0;
	virtual void SendChatMessageToChannel(const char* channelname, const char* message, ...) = 0;
	virtual void AddChatEventHandler(IChatEventHandler* eventhandler) = 0;
};

class ChatServerImpl : protected IChatServer, public Single<ChatServerImpl>
{
	list<IChatEventHandler*> m_eventhandlers;
public:
	void SendChatMessage(const char* message, ...);
	void SendChatMessageToTeam(bool horde, const char* message, ...);
	void SendChatMessageToZone(ui32 zoneid, const char* message, ...);
	void SendChatMessageToChannel(const char* channelname, const char* message, ...);
	void AddChatEventHandler(IChatEventHandler* eventhandler);
};

#endif